#ifndef _SAVEGAME_H
#define _SAVEGAME_H

#include "CQuadtree.h"
#include "Mario.h"
#include "CCamera.h"
#include "CLoadMap.h"
#include <iostream>
#include <fstream>
#include<sstream>
struct SaveGameInfor
{
	int _score;
	int _level;
	int _money;
	int _life;
	Mario *_mario;	
	CQuadtree *_tree;
	CLoadMap *_cloadMap;
	list<GameObject*> _listCreatingAfter;
	SaveGameInfor(){ _mario=NULL;  _cloadMap=NULL; };
};

class SaveGame
{
private:
	//string _treePath;
	string _objectPath;
	string _inforPath;
	SaveGameInfor _data;

	// tool functions
	void saveGameObjects();
	void saveTree();
	// convert from float to string
	string Convert (float number)
	{
		ostringstream buff;
		buff<<number;
		return buff.str();   
	}
public:
	SaveGame(SaveGameInfor data, string objectPath , string inforPath);
	void Save();
	int getIDGameObject(EObjectType type);
};
#endif